﻿Object.defineProperty(Object.prototype, "clone", {
    enumerable: false,
    writable: true,
    value: function () {
        var i, newObj = (this instanceof Array) ? [] : {};
        for (i in this) {
            if (i === 'clone') {
                continue;
            }
            if (this[i] && typeof this[i] === "object") {
                newObj[i] = this[i].clone();
            } else {
                newObj[i] = this[i];
            }
        }
        return newObj;
    }
});